﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;

namespace EPiBoost.Core.CustomProperties.EditorDescriptors
{
	[EditorDescriptorRegistration(TargetType = typeof (CategoryList))]
	public class CategoryProperty : EditorDescriptor
	{
		public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes)
		{
			dynamic mayQuack = metadata;
			//var ownerContent = mayQuack.OwnerContent as IContent;

			metadata.GroupName = SystemTabNames.Categories;

			if (Configuration.Core.EditorDescriptors.CategoryPropertyHidden)
			{
				metadata.ShowForEdit = false;
			}
		} 
	}
}
